package com.guonl.service.gen.impl;

import com.guonl.dao.gen.GenDadabaseMapper;
import com.guonl.entity.gen.GenDadabase;
import com.guonl.model.form.TableListForm;
import com.guonl.service.gen.IGenDadabaseService;
import com.guonl.utils.Convert;
import com.guonl.vo.TableListQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 数据库配置Service业务层处理
 *
 * @author guonl
 * @date 2021-04-01
 */
@Service
public class GenDadabaseServiceImpl implements IGenDadabaseService {

    @Autowired
    private GenDadabaseMapper genDadabaseMapper;

    /**
     * 查询数据库配置
     *
     * @param dbId 数据库配置ID
     * @return 数据库配置
     */
    @Override
    public GenDadabase selectGenDadabaseById(Long dbId) {
        return genDadabaseMapper.selectGenDadabaseById(dbId);
    }

    /**
     * 查询数据库配置列表
     *
     * @param genDadabase 数据库配置
     * @return 数据库配置
     */
    @Override
    public List<GenDadabase> selectGenDadabaseList(GenDadabase genDadabase) {
        return genDadabaseMapper.selectGenDadabaseList(genDadabase);
    }

    /**
     * 新增数据库配置
     *
     * @param genDadabase 数据库配置
     * @return 结果
     */
    @Override
    public int insertGenDadabase(GenDadabase genDadabase) {
        return genDadabaseMapper.insertGenDadabase(genDadabase);
    }

    /**
     * 修改数据库配置
     *
     * @param genDadabase 数据库配置
     * @return 结果
     */
    @Override
    public int updateGenDadabase(GenDadabase genDadabase) {
        return genDadabaseMapper.updateGenDadabase(genDadabase);
    }

    /**
     * 删除数据库配置对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGenDadabaseByIds(String ids) {
        return genDadabaseMapper.deleteGenDadabaseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除数据库配置信息
     *
     * @param dbId 数据库配置ID
     * @return 结果
     */
    @Override
    public int deleteGenDadabaseById(Long dbId) {
        return genDadabaseMapper.deleteGenDadabaseById(dbId);
    }

    @Override
    public List<TableListForm> selectDbTableList(TableListQueryVO queryVO) {
        return null;
    }
}
